package com.season.seasonStudy.smallTool;

import java.io.File;
import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;

/**
 * bdtd获取北京三维主数据数据
 */
public class MDMTool {

    /**
     * 读取大文件（53MB），然后json解析
     * @param args
     */
    public static void main(String[] args) throws Exception {
        // 读取文件
        String content = getTemplateContent();
        int length = content.length();
        System.out.println("length = " + length);

        // json解析

    }

    public static String getTemplateContent() throws Exception{
        File file = new File("C:\\Users\\season\\Desktop\\2.txt");
        if(!file.exists()){
            return null;
        }
        FileInputStream inputStream = new FileInputStream(file);
        int length = inputStream.available();
        byte bytes[] = new byte[length];
        inputStream.read(bytes);
        inputStream.close();
        String str =new String(bytes, StandardCharsets.UTF_8);
        return str ;
    }
}
